(Al-Kahf) 18 : 77
فَانْطَلَقَا حَتَّىٰ إِذَا أَتَيَا أَهْلَ قَرْيَةٍ اسْتَطْعَمَا أَهْلَهَا فَأَبَوْا أَنْ يُضَيِّفُوهُمَا فَوَجَدَا فِيهَا جِدَارًا يُرِيدُ أَنْ يَنْقَضَّ فَأَقَامَهُ ۖ قَالَ لَوْ شِئْتَ لَاتَّخَذْتَ عَلَيْهِ أَجْرًا

So they set out until when they came to the people of a town; they asked its people for food, but they refused to offer them hospitality. And they found therein a wall which is about to be collapsed. So he rebuilt it. He said: "If you had wished, you could have taken a payment for it”.

Just like Messenger Ibrahim didn’t realize that his guest was Angels as explained in verse 11: 69, Moses also didn’t realize that Khidr was among the Angels. That’s why Moses suggested Khidr to ask payment for having food as told in this verse.